#include <stdio.h>
#include <assert.h>
#include <string.h>

char* my_strstr(const char*str1,const char*str2)
{
	assert(str1);
	assert(str2);
	char* p = (char*)str1;
	char* p1, * p2;
	if (*str2 == 0)
	{
		return p;
	}

	while (*p) {
		p1 = p;
		p2 = (char*)str2;
		while (*p1 == *p2)
		{
			p1++;
			p2++;
		}
		if (*p2 == 0)
		{
			return p;
		}
		p++;
	}
	return (NULL);
}


int main()
{
	char a[20] = "abcdefghijk";
		char b[20] = "fghi";
		char c[20] = "fghz";
		printf("%s\n", my_strstr(a, b));
		printf("%s\n", my_strstr(a, c));
		printf("%s\n", strstr(a, b));
		printf("%s\n", strstr(a, c));
	return 0;
}